<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Home</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
		function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css2/style.css" rel="stylesheet" type="text/css" media="all" />
<link rel="stylesheet" href="css/contactstyle.css" type="text/css"
	media="all" />
<link rel="stylesheet" href="css/faqstyle.css" type="text/css"
	media="all" />
<link href="css/single.css" rel='stylesheet' type='text/css' />
<link href="css/medile.css" rel='stylesheet' type='text/css' />
<!-- banner-slider -->
<link href="css/jquery.slidey.min.css" rel="stylesheet">
<!-- //banner-slider -->
<!-- pop-up -->
<link href="css/popuo-box.css" rel="stylesheet" type="text/css"
	media="all" />
<!-- //pop-up -->
<!-- font-awesome icons -->
<link rel="stylesheet" href="css/font-awesome.min.css" />
<!-- //font-awesome icons -->
<!-- js -->
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<!-- //js -->
<!-- banner-bottom-plugin -->
<link href="css/owl.carousel.css" rel="stylesheet" type="text/css"
	media="all">
<script src="js/owl.carousel.js"></script>


<script>
	$(document).ready(function() { 
		$("#owl-demo").owlCarousel({
	 
		  autoPlay: 3000, //Set AutoPlay to 3 seconds
	 
		  items : 5,
		  itemsDesktop : [640,4],
		  itemsDesktopSmall : [414,3]
	 
		});

	})
	 


	
</script>

<script type="text/javascript">
		$(document).ready(function(){
		     
		

			
			 
			 
			$(document).on("click","#search",function(){
			     $.ajax({
			     
			         type: "POST",//方法类型
			         dataType: "json",//预期服务器返回的数据类型
			         url: "${pageContext.request.contextPath}/AdminServlet" ,//url
			         data: $('#lookup').serialize(),
			         success: function (result,status,xhr) {
			        	 $("#searchshow").prop("src","genres.jsp");
			         } ,
			         error : function() {
			             alert("错误！");
			         }
			     });
			 })	
			 $(document).on("click","#allMovies",function(){
			     $.ajax({
			     
			         type: "POST",//方法类型
			         dataType: "json",//预期服务器返回的数据类型
			         url: "${pageContext.request.contextPath}/AdminServlet" ,//url
			         data: {},
			         success: function (result,status,xhr) {
			        	 $("#searchshow").prop("src","list.jsp");
			         } ,
			         error : function() {
			             alert("错误！");
			         }
			     });
			 })	
			//登录模块---------------------------------------------------------------------------------------------	
			$(document).on("click","#login",function(){
				var userName=$("#userName").val();
				var userPassword=$("#userPassword").val();


					// 异步请求
					$.ajax({
						async:true,
		    			url:"${pageContext.request.contextPath}/UserServlet",
		    			type:"POST",
		    			data:{op:"login",
		    				  userName:userName,
		    				  userPassword:userPassword
		    			},
		    			dataType:"json",
		    			success:function(result,status,xhr){
		    				
		    				if(result == null){
		    					alert("用户名或密码错误!")
		    				}else{
		    					$("#accountNameTip").text("");
		    					$("#judgment").text("");
		    					$("#loginItem").empty();
		    					// 判断用户是否有头像
		    					
		    						// 有头像,则请求服务器下载头像
		    						$("#loginItem").append(
		    							"<ul class=\"nav navbar navbar-right\" style=\"margin-top:10px;list-style:none;\">"+
		    								"<li style=\"padding-right:15px;\"><img class=\"imgStyle\" src=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="+result.userPicture+"\" width=\"50\" height=\"50\" /></li>"+
		    								"<li style=\"color:black;padding-right:15px;padding-top:15px;\"><span class=\"icon-bar\">欢迎您："+result.userName+"</span></li><br/>"+
			    				          	"<li style=\"float:left;padding-right:15px;\"><button type=\"button\" class=\"button blue\" id=\"logout\">个人中心</button>"+
			    				          	"<button type=\"button\" class=\"button blue\" id=\"logout\">注销</button></li>"+
			    				          	
			    				         "</ul> ")
		    					
		    					
		    					// 隐藏框设值
		    					$("#loginFlag").val("true");
		    				}
		    			},
		    			error:function(xhr,status,error){
							alert("登陆失败");
						}
					});
				
			})
			//注册
			$(document).on("click","#register",function(){
				var userName=$("#reuserName").val();
				var userPassword=$("#reuserPassword").val(); 
				if(userName.trim().length==0||userPassword.trim().length==0){			
					alert("用户名或密码不能为空");
					return;
				}
				var data = new FormData($("#registered")[0])
				$.ajax({
						async:true,
						url:"${pageContext.request.contextPath}/UserServlet",
						type:"post",
						data:data,
						dataType:"json",
						contentType:false,
						processData: false,
						success:function(result,status,xhr){
							alert("注册成功");	
							$("#reuserName").val("");
							$("#reuserPassword").val("");
							$("#accountNameTip2").text("");
							$("#accountNameTip3").text("");
						},
						error:function(xhr,status,error){
						}
					});
			})
    	
			// 对账号输入框绑定失去焦点事件
			$("#reuserName").blur(function(){
				// 获取输入的账号
				var accountName = $(this).val().trim();
				var userPassword=$("#reuserPassword").val();
				$("#reuserPassword").val("");
				if(accountName.trim().length==0){
					$("#register").attr("disabled", true);
					$("#accountNameTip2").text("用户名不可为空");
 					//$("#accountNameTip").addClass("error");
 					 $("#accountNameTip2").css({"color":"RED","font-size":"12px"});

				}else{
					if(userPassword.trim().length==0){
 						$("#register").attr("disabled", true);
 						$("#accountNameTip3").text("密码不可为空");
	 					//$("#accountNameTip").addClass("error");
	 					 $("#accountNameTip3").css({"color":"RED","font-size":"12px"});
 					}
					// 发送ajax请求
					$.ajax({
						async:true,
						url:"${pageContext.request.contextPath}/UserServlet",
						type:"GET",
						data:{op:"existsOfUserName",accountName:accountName},
						dataType:"json",
						success:function(result,status,xhr){
			         		   if(result=="true"){
			         			  
			              		   $("#accountNameTip2").text("用户名可用");
			      					//$("#accountNameTip").addClass("error");
			      					 $("#accountNameTip2").css({"color":"GREEN","font-size":"12px"});
			     					$("#reuserPassword").blur(function(){
			    						// 获取输入的账号
			    						var accountPassword = $(this).val().trim();

			    						if(accountPassword.trim().length==0){
			    							$("#register").attr("disabled", true);
			    							$("#accountNameTip3").text("密码不可为空");
			    		 					//$("#accountNameTip").addClass("error");
			    		 					 $("#accountNameTip3").css({"color":"RED","font-size":"12px"});
			    						}else{
			    							$("#register").attr("disabled", false);
			    							$("#accountNameTip3").text("");
			    		 					//$("#accountNameTip").addClass("error");
			    		 					 $("#accountNameTip3").css({"color":"GREEN","font-size":"12px"});
			    						}
			    				})
			              		   }if(result=="false"){
			              			 $("#register").attr("disabled", true); 
			                  		   $("#accountNameTip2").text("用户名已存在");
			         					//$("#accountNameTip").addClass("error");
			         					 $("#accountNameTip2").css({"color":"RED","font-size":"12px"});
			         					$("#reuserPassword").blur(function(){
			         						$("#register").attr("disabled", true);
			         					})
			                 		   }
			    					
						},
						error:function(xhr,status,error){
						}
					});
				}
		})

		
            $(document).on("change","#file",function(){
            	
				var file = $(this).get(0).files[0];
				if (file==null) {
					$("#faceImg").attr("src","#");
				}else {
					var size = file.size/1024
					if (size>2000) {
						alert("文件大小不能超过2M");
						$(this).val("");
					}else{
						var reads = new FileReader();
						reads.readAsDataURL(file);
						reads.onload = function(){
							// 显示图片
							$("#faceImg").attr("src",this.result);
						}
					}
				}
			})
						
    		
    		// 异步请求注销
    		$(document).on("click","#logout",function(){
    			$.ajax({
    				async:true,
	    			url:"${pageContext.request.contextPath}/UserServlet",
	    			type:"POST",
	    			data:{op:"logout"},
	    			dataType:"json",
	    			success:function(result,status,xhr){
	    				$("#loginItem").empty();
	    				$("#loginItem").append("<ul>"
								+"<li><a href=\"#\" data-toggle=\"modal\" data-target=\"#myModal\">登录</a></li>"
								+"</ul>");
	    				
 
	    			},
	    			error:function(xhr,status,error){
						alert("登录失败");
					}
    			})
    		});  
    		

    		 
    	//对登录窗口失去焦点事件
    	$(document).on("blur","#userName",function(){
    		
			var userName=$("#userName").val();
			var userPassword=$("#userPassword").val();
    		$.ajax({
				async:true,
    			url:"${pageContext.request.contextPath}/UserServlet",
    			type:"POST",
    			data:{op:"esistOfUser",userName:userName},
    			dataType:"json",
    			success:function(result,status,xhr){
    				if(result=="true"){
    					$("#accountNameTip").text("用户名不存在请先注册");
    					//$("#accountNameTip").addClass("error");
    					 $("#accountNameTip").css({"color":"RED","font-size":"12px"});
    				}if(result=="false"){
    					$("#accountNameTip").text("用户名正确");
    					$("#accountNameTip").css({"color":"GREEN","font-size":"12px"});
    					
    					
    				}
    			},
    			error:function(xhr,status,error){
					alert("登录失败");
				}
			})
			if(userName.trim().length==0 || userPassword.trim().length==0){
				 $("#judgment").text("用户名或密码不能为空");
					//$("#accountNameTip").addClass("error");
					 $("#judgment").css({"color":"RED","font-size":"12px"});

			}else{
				$("#judgment").text("");

			}
	})
	$(document).on("blur","#userPassword",function(){
    		
			var userName=$("#userName").val();
			var userPassword=$("#userPassword").val();

			if(userName.trim().length==0 || userPassword.trim().length==0){
				 $("#judgment").text("用户名或密码不能为空");
					//$("#accountNameTip").addClass("error");
					 $("#judgment").css({"color":"RED","font-size":"12px"});
			}else{
				$("#judgment").text("");

			}
	})
})
	</script>
	


<!-- //banner-bottom-plugin -->
<!---<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,700italic,700,400italic,300italic,300' rel='stylesheet' type='text/css'>--->
<!-- start-smoth-scrolling -->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function($) {
		$(".scroll").click(function(event){		
			event.preventDefault();
			$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
		});
	});
</script>
<!-- start-smoth-scrolling -->

<style>
#faceImg{
border-radius:50%;

}
.imgStyle{
border-radius:50%;
}
.
</style>

</head>

<body>


	<script>
		$('.toggle').click(function(){
		  // Switches the Icon
		  $(this).children('i').toggleClass('fa-pencil');
		  // Switches the forms  
		  $('.form').animate({
			height: "toggle",
			'padding-top': 'toggle',
			'padding-bottom': 'toggle',
			opacity: "toggle"
		  }, "slow");
		});
	</script>
	<!-- //bootstrap-pop-up -->
	<!-- nav -->


<!-- //nav -->


<!-- banner -->


		<div id="slidershow" class="carousel slide" data-ride="carousel" data-interval = 2000 data-pause = "hover" data-wrap="true" style=" margin:10px 10px; display : block; z-index:99;">
		 <!-- 设置图片轮播的顺序 -->
			 <ol class="carousel-indicators" style="bottom: 30px;">
				 <li class="active" data-target="#slidershow" data-slide-to="0" ></li>
				 <li data-target="#slidershow" data-slide-to="1"></li>
				 <li data-target="#slidershow" data-slide-to="2"></li>
			 </ol>
			 <!--设置轮播的图片-->
			 <div class="carousel-inner">
				<div class="item active">
				 <a href="single.jsp?id=25763"><img src="images/5.jpg" alt="cat1" class="center-block"></a>
				 </div>
				 <div class="item">
				 <a href="single.jsp?id=27486"><img src="images/2.jpg" alt="cat2" class="center-block"></a>
				 </div>
				 <div class="item">
				 <a href="single.jsp?id=26666"><img src="images/3.jpg" alt="cat3" class="center-block"></a>
				 </div>
			 </div>
			 <a class="left carousel-control" href="#slidershow" role="button" data-slide="prev" >
			 	<span class="glyphicon glyphicon-chevron-left"></span>
			 </a>
			 <a class="right carousel-control" href="#slidershow" role="button" data-slide="next">
		     	<span class="glyphicon glyphicon-chevron-right"></span>
		     </a> 
		</div>






	<!--  <div id="slidey"   style="display:none;" class="Rotationchart">
		<ul >
			 <li><img src="images/5.jpg" alt=" "><p class='title'>修改</p><p class='description'> Tarzan, having acclimated to life in London, is called back to his former home in the jungle to investigate the activities at a mining encampment.</p></li>
			<li><img src="images/2.jpg" alt=" "><p class='title'>Maximum Ride</p><p class='description'>Six children, genetically cross-bred with avian DNA, take flight around the country to discover their origins. Along the way, their mysterious past is ...</p></li>
			<li><img src="images/3.jpg" alt=" "><p class='title'>Independence</p><p class='description'>The fate of humanity hangs in the balance as the U.S. President and citizens decide if these aliens are to be trusted ...or feared.</p></li>
			<li><img src="images/4.jpg" alt=" "><p class='title'>Central Intelligence</p><p class='description'>Bullied as a teen for being overweight, Bob Stone (Dwayne Johnson) shows up to his high school reunion looking fit and muscular. Claiming to be on a top-secret ...</p></li>
			<li><img src="images/6.jpg" alt=" "><p class='title'>Ice Age</p><p class='description'>In the film's epilogue, Scrat keeps struggling to control the alien ship until it crashes on Mars, destroying all life on the planet.</p></li>
			<li><img src="images/7.jpg" alt=" "><p class='title'>X - Man</p><p class='description'>In 1977, paranormal investigators Ed (Patrick Wilson) and Lorraine Warren come out of a self-imposed sabbatical to travel to Enfield, a borough in north ...</p></li>
		</ul>   	
    </div> 
     <script src="js/jquery.slidey.js"></script>
    <script src="js/jquery.dotdotdot.min.js"></script>
	   <script type="text/javascript">


			$("#slidey").slidey({
				interval: 4000,
				listCount: 5,
				autoplay: false,
				showList: true
			});
			$(".slidey-list-description").dotdotdot();


		</script>  -->
<!-- //banner -->
<!-- banner-bottom -->
	<div class="banner-bottom" style="padding:1em 0;">
		<div class="container">
			<div class="swiper-container w3_agile_banner_bottom_grid ">
					<div class="swiper-wrapper">
					
						
					</div>
			</div>		
		</div>
	</div>
<!-- 	<div class="tlinks">Collect from <a href="http://www.cssmoban.com/" >手机网站模板</a></div> -->
<!-- //banner-bottom -->

	<!--  <div id="slidey"   style="display:none;" class="Rotationchart">
		<ul >
			 <li><img src="images/5.jpg" alt=" "><p class='title'>修改</p><p class='description'> Tarzan, having acclimated to life in London, is called back to his former home in the jungle to investigate the activities at a mining encampment.</p></li>
			<li><img src="images/2.jpg" alt=" "><p class='title'>Maximum Ride</p><p class='description'>Six children, genetically cross-bred with avian DNA, take flight around the country to discover their origins. Along the way, their mysterious past is ...</p></li>
			<li><img src="images/3.jpg" alt=" "><p class='title'>Independence</p><p class='description'>The fate of humanity hangs in the balance as the U.S. President and citizens decide if these aliens are to be trusted ...or feared.</p></li>
			<li><img src="images/4.jpg" alt=" "><p class='title'>Central Intelligence</p><p class='description'>Bullied as a teen for being overweight, Bob Stone (Dwayne Johnson) shows up to his high school reunion looking fit and muscular. Claiming to be on a top-secret ...</p></li>
			<li><img src="images/6.jpg" alt=" "><p class='title'>Ice Age</p><p class='description'>In the film's epilogue, Scrat keeps struggling to control the alien ship until it crashes on Mars, destroying all life on the planet.</p></li>
			<li><img src="images/7.jpg" alt=" "><p class='title'>X - Man</p><p class='description'>In 1977, paranormal investigators Ed (Patrick Wilson) and Lorraine Warren come out of a self-imposed sabbatical to travel to Enfield, a borough in north ...</p></li>
		</ul>   	
    </div> 
     <script src="js/jquery.slidey.js"></script>
    <script src="js/jquery.dotdotdot.min.js"></script>
	   <script type="text/javascript">


			$("#slidey").slidey({
				interval: 4000,
				listCount: 5,
				autoplay: false,
				showList: true
			});
			$(".slidey-list-description").dotdotdot();


		</script>  -->
<!-- //banner -->

	</div>
<!-- 	<div class="tlinks">Collect from <a href="http://www.cssmoban.com/" >手机网站模板</a></div> -->
<!-- //banner-bottom -->



<!-- general -->
	<div class="general">
		<h4 class="latest-text w3_latest_text">精选电影</h4>
		<div class="container">
			<div class="bs-example bs-example-tabs" role="tabpanel" data-example-id="togglable-tabs">
				<ul id="myTab" class="nav nav-tabs" role="tablist">
					<li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab" aria-controls="home" aria-expanded="true">精选</a></li>
					<li role="presentation"><a href="#profile" role="tab" id="profile-tab" data-toggle="tab" aria-controls="profile" aria-expanded="false">点击量</a></li>
					<li role="presentation"><a href="#rating" id="rating-tab" role="tab" data-toggle="tab" aria-controls="rating" aria-expanded="true">评分</a></li>
				</ul>
				<div id="myTabContent" class="tab-content">
					<div role="tabpanel" class="tab-pane fade active in" id="home" aria-labelledby="home-tab">
						
							<div class="col-md-2 w3l-movie-gride-agile">
								<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m15.jpg" title="album-name" class="img-responsive" alt=" " />
									<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
								</a>
								<div class="mid-1 agileits_w3layouts_mid_1_home">
									<div class="w3l-movie-text">
										<h6><a href="single.html">God’s Compass</a></h6>							
									</div>
									<div class="mid-2 agile_mid_2_home">
										<p>2016</p>
										<div class="block-stars">
											<ul class="w3l-ratings">
												<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
												<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
												<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
												<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
												<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											</ul>
										</div>
										<div class="clearfix"></div>
									</div>
								</div>
							
							</div>
								
								
							<!-- 精选 -->
							
							<div class="clearfix"> </div>
						
					</div>
					<div role="tabpanel" class="tab-pane fade" id="profile" aria-labelledby="profile-tab">
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m22.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Assassin's Creed 3</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>点击量</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						<!-- 点击量 -->
						
						
						
						
						<div class="clearfix"> </div>
					</div>
					<div role="tabpanel" class="tab-pane fade" id="rating" aria-labelledby="rating-tab">
					
					
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m7.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Light B/t Oceans</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>评分</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						
						
						
						
						<div class="clearfix"> </div>
					</div>
					<div role="tabpanel" class="tab-pane fade" id="imdb" aria-labelledby="imdb-tab">
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m22.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Assassin's Creed 3</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>2016</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m2.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Bad Moms</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>2016</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m9.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Central Intelligence</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>2016</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m10.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Don't Think Twice</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>2016</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						<div class="col-md-2 w3l-movie-gride-agile">
							<a href="single.html" class="hvr-shutter-out-horizontal"><img src="images/m23.jpg" title="album-name" class="img-responsive" alt=" " />
								<div class="w3l-action-icon"><i class="fa fa-play-circle" aria-hidden="true"></i></div>
							</a>
							<div class="mid-1 agileits_w3layouts_mid_1_home">
								<div class="w3l-movie-text">
									<h6><a href="single.html">Dead Island 2</a></h6>							
								</div>
								<div class="mid-2 agile_mid_2_home">
									<p>2016</p>
									<div class="block-stars">
										<ul class="w3l-ratings">
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-half-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
											<li><a href="#"><i class="fa fa-star-o" aria-hidden="true"></i></a></li>
										</ul>
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
							
						</div>
						<div class="clearfix"> </div>
					</div>
				</div>
			</div>
		</div>
	</div>
<!-- //general -->
<!-- Latest-tv-series -->


	
	<div class="tlinks">
		Collect from <a href="http://www.cssmoban.com/">手机网站模板</a>
	</div>
	<!-- //banner-bottom -->



	<!-- general -->
	
	<!-- //general -->
	<!-- Latest-tv-series -->

	<!-- pop-up-box -->
	<script src="js/jquery.magnific-popup.js" type="text/javascript"></script>
	<!--//pop-up-box -->
	<div id="small-dialog" class="mfp-hide">
		<!---<iframe src="https://player.vimeo.com/video/164819130?title=0&byline=0"></iframe>--->
	</div>
	<div id="small-dialog1" class="mfp-hide">
		<!---<iframe src="https://player.vimeo.com/video/148284736"></iframe>--->
	</div>
	<div id="small-dialog2" class="mfp-hide">
		<!---<iframe src="https://player.vimeo.com/video/165197924?color=ffffff&title=0&byline=0&portrait=0"></iframe>--->
	</div>
	<script>
		$(document).ready(function() {
		$('.w3_play_icon,.w3_play_icon1,.w3_play_icon2').magnificPopup({
			type: 'inline',
			fixedContentPos: false,
			fixedBgPos: true,
			overflowY: 'auto',
			closeBtnInside: true,
			preloader: false,
			midClick: true,
			removalDelay: 300,
			mainClass: 'my-mfp-zoom-in'
		});
																		
		});
	</script>
	<!-- //Latest-tv-series -->
	<!-- footer -->

	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.min.js"></script>
	<script>
$(document).ready(function(){
    $(".dropdown").hover(            
        function() {
            $('.dropdown-menu', this).stop( true, true ).slideDown("fast");
            $(this).toggleClass('open');        
        },
        function() {
            $('.dropdown-menu', this).stop( true, true ).slideUp("fast");
            $(this).toggleClass('open');       
        }
    );
});
</script>
	<!-- //Bootstrap Core JavaScript -->
	<!-- here stars scrolling icon -->
	<script type="text/javascript">
		$(document).ready(function() {	
			//点击量
			$(document).on("click",".movie",function(){
				var i=$(this).attr("data-id");

				
				 $.ajax({
				     
			         type: "POST",//方法类型
			         dataType: "json",//预期服务器返回的数据类型
			         url: "${pageContext.request.contextPath}/AdminServlet" ,//url
			         data:{op:"addCount",id:i},
			         success: function (result,status,xhr) {

			         } ,
			         error : function() {
			             alert("错误！");
			         }
			     });
			});	
			$().UItoTop({ easingType: 'easeOutQuart' });
								
			});
	</script>


	<script>

	//轮播图电影排序(最新)：
	
	 $.ajax({//ajax
			 async:true,
			 type:"get",
		     dataType:"json", 
			 url:"${pageContext.request.contextPath}/MoviesSearch",
			 data:{
				 op:"searchMoviesByQualityChoice",
				 publickDate:"yes"
			 },
			 
			 success:function(result,status,xhr){
				 result=result.slice(0,6);
// 					 fullrotaionchart(result);
					
			 
			 },
			 error:function(error,status){
				 console.log(status);
				console.log(error)
			 }
			
		});
		function fullrotaionchart(result){
			$(".carousel-inner").empty();
			$(".carousel-indicators").empty();
			$.each(result,function(index,movies){
				
				if(index==0){
					$(".carousel-inner").append("<div class=\"item active\"><a class=\"movie\" data-id=\""+movies.movieId+"\" href=\"single.jsp?id="+movies.movieId+"\"><img src=\""+movies.moviePicture+"\" class=\"center-block\" alt=\"cat1\"><div class=\"carousel-caption\" style=\"padding-bottom: 15px;\"><h4>"+movies.movieName+"</h4> <br\> "+movies.movieIntro.slice(0,80)+"....</div></a></div>")
					$(".carousel-indicators").append(" <li class=\"active\" data-target=\"#slidershow\" data-slide-to=\"0\" ></li>");
				}else{
					$(".carousel-inner").append("<div class=\"item\"><a class=\"movie\" data-id=\""+movies.movieId+"\" href=\"single.jsp?id="+movies.movieId+"\"><img src=\""+movies.moviePicture+"\" class=\"center-block\" alt=\"cat1\"><div class=\"carousel-caption\"  style=\"padding-bottom: 15px;\" > <h4>"+movies.movieName+"</h4><br\>"+movies.movieIntro.slice(0,80)+"...</div></a></div>")
					$(".carousel-indicators").append(" <li data-target=\"#slidershow\" data-slide-to=\""+index+"\"></li>");
				}	
			})
		}
			
		
		
		
		
		function fullMoviesList(a,result){//根据条件 填充下面的精选电影
			    
				a.empty();
				result=result.slice(0,6);
				$.each(result,function(index,movies){
					a.append(" <div class=\"col-md-2 w3l-movie-gride-agile\">"+
							"<a class=\"movie\" data-id=\""+movies.movieId+"\" href=\"single.jsp?id="+movies.movieId+"\" class=\"hvr-shutter-out-horizontal\"><img style=\"height:268px; width:182px;\" src=\""+movies.moviePicture+"\" title=\"album-name\" class=\"img-responsive\" alt=\" \" />"+
								"<div class=\"w3l-action-icon\"><i class=\"fa fa-play-circle\" aria-hidden=\"true\"></i></div>"+
							"</a>"+
							"<div class=\"mid-1 agileits_w3layouts_mid_1_home\">"+
								"<div class=\"w3l-movie-text\">"+
									"<h6><a class=\"movie\" data-id=\""+movies.movieId+"\" href=\"single.jsp?id="+movies.movieId+"\">"+movies.movieName+"</a></h6>"+						
								"</div>"+
								"<div class=\"mid-2 agile_mid_2_home\">"+
									"<p>"+movies.moviePublishDate+"</p>"+
									"<div class=\"block-stars\">"+
										"<ul class=\"w3l-ratings\">"+
											"<li>评分:"+movies.movieRating+"</li>"+
										"</ul>"+
									"</div>"+
									"<div class=\"clearfix\"></div>"+
								"</div>"+
							"</div>"+
						"</div>");
				
				})
				a.append("<div class=\"clearfix\"> </div>")
				}

	
	 $.ajax({//ajax
			 async:true,//电影排序(最新)：
			 type:"get",
		     dataType:"json", 
			 url:"${pageContext.request.contextPath}/MoviesSearch",
			 data:{
				 op:"searchMoviesByQualityChoice",
				 publickDate:"yes"
			 },
			 
			 success:function(result,status,xhr){
					/* console.log("精选电影:"+result); */
					var a=$("#home");
					fullMoviesList(a,result)
					
			 
			 },
			 error:function(error,status){
				 console.log(status);
				console.log(error)
			 }
			
		});
			
		 $.ajax({//ajax
			 async:true,//取前6电影排序(点击量)：
			 type:"get",
		     dataType:"json", 
			 url:"${pageContext.request.contextPath}/MoviesSearch",
			 data:{
				 op:"searchMoviesByQualityChoice",
				 clickCount:"yes"
			 },
			 
			 success:function(result,status,xhr){
					/* console.log("精选电影:"+result); */
					var a=$("#profile");
					fullMoviesList(a,result)
					
			 
			 },
			 error:function(error,status){
				 console.log(status);
				console.log(error)
			 }
			
		}); $.ajax({//ajax
			 async:true,//电影排序(最高分)：
			 type:"get",
		     dataType:"json", 
			 url:"${pageContext.request.contextPath}/MoviesSearch",
			 data:{
				 op:"searchMoviesByQualityChoice",
				 score:"yes"
			 },
			 
			 success:function(result,status,xhr){
					/* console.log("精选电影:"+result); */
					var a=$("#rating");
					fullMoviesList(a,result)
					
			 
			 },
			 error:function(error,status){
				 console.log(status);
				console.log(error)
			 }
			
		});	
	 
			
	</script>

	<script>/*大轮播图底下的卡片轮播  */
	 $.ajax({//ajax
		 async:true,
		 type:"get",
	     dataType:"json", 
		 url:"${pageContext.request.contextPath}/MoviesSearch",
		 data:{
			 op:"searchMoviesByQualityChoice",
			 score:"yes",
			 clickCount:"yes"
		 },
		 
		 success:function(result,status,xhr){
			 result=result.slice(0,6);
			
				
				 selectTheMovies(result);
				
		 
		 },
		 error:function(error,status){
			 console.log(status);
			console.log(error)
		 }
		
	});  
function selectTheMovies(result){
	$(".swiper-wrapper").empty();
	$.each(result,function(index,movies){
		$(".swiper-wrapper").append("<div class=\"swiper-slide w3l-movie-gride-agile\">"+
		  		"<a class=\"movie\" data-id=\""+movies.movieId+"\" href=\"single.jsp?id="+movies.movieId+"\" class=\"hvr-shutter-out-horizontal\"><img  style=\"height:268px; width:182px;\"  src=\""+movies.moviePicture+"\" title=\"album-name4\" class=\"img-responsive\" alt=\" \" />"+
					"<div class=\"w3l-action-icon\"><i class=\"fa fa-play-circle\" aria-hidden=\"true\"></i></div>"+
				"</a>"+
				"<div class=\"mid-1 agileits_w3layouts_mid_1_home\">"+
						"<div class=\"w3l-movie-text\">"+
							"<h6><a class=\"movie\" data-id=\""+movies.movieId+"\" href=\"single.jsp?id="+movies.movieId+"\">"+movies.movieName+"</a></h6>"+							
						"</div>"+
						"<div class=\"mid-2 agile_mid_2_home\">"+
							"<p style=\" float: unset;line-height: 15px;\">"+movies.moviePublishDate+"</p>"+
							"<div class=\"block-stars\">"+
								"<ul class=\"w3l-ratings\">"+
									"<li style=\"position: absolute;left: 70px;\">评分:"+movies.movieRating+"</li>"+
								"</ul>"+
							"</div>"+
							"<div class=\"clearfix\"></div>"+
						"</div>"+
				"</div>"+
		"</div>");	
		
		
	});
}
	</script>
	
		<!-- 卡片轮播的样式 -->
		<link rel="stylesheet" href="css/swiper.css">  
		<link rel="stylesheet" href="css/swiper.min.css">  
		<script src="js/swiper.js"> </script>
		<script src="js/swiper.min.js"> </script>
		<script>
			
			var appendNumber = 4;
			var prependNumber = 1;
			var swiper = new Swiper('.swiper-container', {
				  loop: true,
				  slidesPerView: 6,
				  centeredSlides: false,
				  spaceBetween: 0,
				  loopedSlides:6,
			  autoplay: {
			      delay: 2500,
			      disableOnInteraction: false,
			   },
			  pagination: {
			    el: '.swiper-pagination',
			    clickable: true,
			  },
			  navigation: {
			    nextEl: '.swiper-button-next',
			    prevEl: '.swiper-button-prev',
			  },
			});
			</script>




	<!-- //here ends scrolling icon -->
	<script>
         var loginErrorMessage="${param.fileuploaderror}";
         if(loginErrorMessage=="fileuploaderror"){
         	alert("上传头像文件格式不合法!");
         }
        </script>


	<!-- //here ends scrolling icon -->
	<script>
		var loginErrorMessage="${param.status}";
	    if(loginErrorMessage=="unlogin"){
	       alert("请先登录");
	    }
    </script>

</body>
</html>